package com.lineage.data.item_etcitem;

import com.lineage.data.executor.ItemExecutor;
import com.lineage.server.model.Instance.L1ItemInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.serverpackets.S_SPMR;
import com.lineage.server.serverpackets.S_ServerMessage;
import com.lineage.server.serverpackets.S_SkillSound;
import com.lineage.server.serverpackets.ServerBasePacket;

public class Battle_Reel extends ItemExecutor {
  public static ItemExecutor get() {
    return new Battle_Reel();
  }
  
  public void execute(int[] data, L1PcInstance pc, L1ItemInstance item) {
    if (item == null)
      return; 
    if (pc == null)
      return; 
    if (!pc.hasSkillEffect(8060)) {
      pc.setSkillEffect(8060, 3600000);
      pc.getInventory().removeItem(item, 1L);
      pc.addHitup(3);
      pc.addDmgup(3);
      pc.addBowHitup(3);
      pc.addBowDmgup(3);
      pc.addSp(3);
      pc.sendPackets((ServerBasePacket)new S_SPMR(pc));
      pc.sendPacketsAll((ServerBasePacket)new S_SkillSound(pc.getId(), 6995));
    } else {
      int time = pc.getSkillEffectTimeSec(8060);
      pc.sendPackets((ServerBasePacket)new S_ServerMessage("战斗强化卷轴 剩余时间(秒):" + time));
    } 
  }
}
